import request from '@/utils/request'
const BASE_URL = '/apis'

export function getSourceList(param) {
  return request({
    url: BASE_URL + '/tables/' + param,
    method: 'get'
  })
}

export function deleteSource(param, data) {
  return request({
    url: BASE_URL + '/tables/' + param,
    method: 'post',
    data: data
  })
}

export function handleSource(param, data) {
  return request({
    url: BASE_URL + '/tables/' + param,
    method: 'post',
    data: data
  })
}

// 查询隔离日志
export function getLogList(param) {
  return request({
    url: BASE_URL + '/api/v1/resource/unavailable_res_log/search' + param,
    method: 'get'
  })
}

// 镜像（查询-Get、创建-Post、删除-Delete）
export function handleImage(method, data, params) {
  return request({
    url: BASE_URL + '/api/v1/images/image',
    method: method,
    data: data,
    params
  })
}

// 隔离资源（查询-Get、创建-Post、更新-Put、删除-Delete）
export function handleUnavailable(method, data) {
  return request({
    url: BASE_URL + '/api/v1/resource/unavailable_resource',
    method: method,
    data: data
  })
}
